package com.martin.fast_frame_compose.page.home

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.martin.lib_base.ui.screen.Center
import com.martin.lib_base.ui.theme.CommonTheme

@Composable
fun HomePage(vModel: HomeViewModel) {
    CommonTheme(lifecycleObserver = vModel) {
        Column(modifier = Modifier.fillMaxWidth()) {
            vModel.actionList.forEach {
                Center(modifier = Modifier
                    .clickable {
                        vModel.onActionClick(it)
                    }
                    .fillMaxWidth()
                    .padding(vertical = 15.dp)) {
                    Text(text = it)
                }
            }
        }
    }
}
